// person.h : Implementation of the Cperson class



// Cperson implementation

// code generated on Sunday, June 07, 2009, 9:46 AM

#include "stdafx.h"
#include "person.h"
IMPLEMENT_DYNAMIC(Cperson, CRecordset)

Cperson::Cperson(CDatabase* pdb)
	: CRecordset(pdb)
{
	m_per_id = 0;
	m_per_firstname = "";
	m_per_lastname = "";
	m_per_email = "";
	m_per_photo;
	m_nFields = 5;
	m_nDefaultType = snapshot;
}

// The connection string below may contain plain text passwords and/or
// other sensitive information. Please remove the #error after reviewing
// the connection string for any security related issues. You may want to
// store the password in some other form or use a different user authentication.
CString Cperson::GetDefaultConnect()
{
	return _T("DSN=sdc_local;Driver={MySQL ODBC 5.1 Driver};DESCRIPTION=by kevin XPS;SERVER=localhost;charset=UTF8;UID=sdc_test;Password=sdc_test;DATABASE=sdc_test;PORT=3306");
}

CString Cperson::GetDefaultSQL()
{
	return _T("[person]");
}

void Cperson::DoFieldExchange(CFieldExchange* pFX)
{
	pFX->SetFieldType(CFieldExchange::outputColumn);
// Macros such as RFX_Text() and RFX_Int() are dependent on the
// type of the member variable, not the type of the field in the database.
// ODBC will try to automatically convert the column value to the requested type
	RFX_Long(pFX, _T("[per_id]"), m_per_id);
	RFX_Text(pFX, _T("[per_firstname]"), m_per_firstname);
	RFX_Text(pFX, _T("[per_lastname]"), m_per_lastname);
	RFX_Text(pFX, _T("[per_email]"), m_per_email);
	RFX_LongBinary(pFX, _T("[per_photo]"), m_per_photo);

}
/////////////////////////////////////////////////////////////////////////////
// Cperson diagnostics

#ifdef _DEBUG
void Cperson::AssertValid() const
{
	CRecordset::AssertValid();
}

void Cperson::Dump(CDumpContext& dc) const
{
	CRecordset::Dump(dc);
}
#endif //_DEBUG


